package sandbox;

import org.lwjgl.input.Keyboard;

public class CollisionKeyboard {
    public CollisionKeyboard() {
         
    }
     
    public static int checkForward(int y) {
        if(y >= 0) {
            if(Keyboard.isKeyDown(Keyboard.KEY_W) || Keyboard.isKeyDown(Keyboard.KEY_UP)) {
                y -= 1;
            }
        }
         
            return y;
    }
     
    public static int checkBackward(int y) {
        if(y <= 400) {
            if(Keyboard.isKeyDown(Keyboard.KEY_S) || Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
                y += 1;
            }
        }
         
        return y;
    }
     
    public static int checkLeft(int x) {
        if(x >= 0) {
            if(Keyboard.isKeyDown(Keyboard.KEY_A)|| Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
                x -= 1;
            }
        }
         
        return x;
    }
     
    public static int checkRight(int x) {
        if(x <= 600) {
            if(Keyboard.isKeyDown(Keyboard.KEY_D) || Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
                x += 1;
            }
        }
             
        return x;
    }
}